package com.power.service;

import com.power.ov.ResultData;
import com.power.pojo.Roles;
import com.power.pojo.Users;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: 朱雄
 * Date: 2020/10/04 22:58
 * Description:
 * Version: V1.0
 */
public interface UsersService {
    /**
     * 判断密码是否正确
     * @param user_account
     * @param old_pwd
     * @return
     */
   ResultData findByAccount(String user_account, String old_pwd) throws SQLException;

    /**
     * 用户个人信息修改
     * @param users
     * @return
     */
    ResultData userUpdate(Users users) throws SQLException;

    /**
     * 查询所有角色
     * @return
     */
    ResultData queryRole() throws SQLException;

    /**
     * 修改角色
     * @param roles
     * @return
     */
    ResultData roleUpdate(Roles roles) throws SQLException;

    /**
     * 判断角色名是否唯一
     * @param roleName
     * @return
     */
    ResultData findByRoleName(String roleName) throws SQLException;

 /**
  * 添加角色
  * @param roleName
  * @return
  */
    ResultData addRole(String roleName) throws SQLException;

    /**
     * 角色的条件查询
     * @param roleName
     * @param roleStatee
     * @return
     */
    ResultData queryByNameAndState(String roleName, String roleStatee) throws SQLException;

    /**
     * 用户查询
     * @param page
     * @param limit
     * @return
     */
    ResultData userQuery(String page, String limit) throws SQLException;

    /**
     * 修改用户
     * @param users
     * @return
     */
    ResultData updateUser(Users users) throws SQLException;

    /**
     * 添加用户
     * @param users
     * @return
     */
    ResultData addUser(Users users) throws SQLException;

    /**
     * 用户的条件查询
     * @param user_name
     * @param user_state
     * @param page
     * @param limit
     * @return
     */
    ResultData queryByUser(String user_name, String user_state, String page, String limit) throws SQLException;

    /**
     * 删除用户
     * @param userAccount
     * @return
     */
    ResultData deleteUser(String userAccount) throws SQLException;

    /**
     * 判断用户账号是否重复
     * @param userAccount
     * @return
     */
    ResultData judgeUserAcc(String userAccount) throws SQLException;

    /**
     * 查询角色所拥有的角色
     * @param roleId
     * @return
     */
    ResultData queryAuthorityAll(String roleId) throws SQLException;

    /**
     * 权限修改
     * @param roleId
     * @param list
     * @return
     */
    ResultData updateAuthority(String roleId, List<Map> list) throws SQLException;
}
